1. Field of the Invention
The present invention relates to a motor control apparatus and control method applied to a spindle motor or the like, which drives a machine tool.
2. Description of the Related Art
FIG. 14 shows a control block diagram of a conventional motor control apparatus having a switch unit adapted to switch between a position loop and a velocity loop according control modes to deal with a position control operation and a velocity control operation. Referring to FIG. 14, a velocity instruction means 2 in an instruction generating means 1 generates a velocity instruction signal Vrf, while a position instruction means 3 in the instruction generating means 1 generates a position instruction signal θr.
A switching means 4 is adapted to switch between a position control operation and a velocity control operation. A switching control means 4a is adapted to control switches 4b and 4c to thereby switch between a position control loop and a speed control loop. When a position control operation is requested, a position deviation signal θe representing the difference between a position instruction signal θr having passed through the switch 4b, which is in a connected state, and a position signal θs, which is detected by a position detecting means 6 and represents the position of a motor 13, is inputted to a position control means 5. The position control means 5 outputs a velocity instruction operation signal Vr obtained by converting the inputted signal into a velocity instruction. Incidentally, when a position control operation is requested, or when spindle orientation is performed, a position instruction signal θr is outputted from the instruction generating means 1. However, when a velocity control operation is requested, the switch 4b is in a connected state. Further, the switch 4c is connected to an upper contact, as viewed in the figure. Thus, a velocity instruction signal Vrv outputted from a velocity instruction means 2 passes through the switch 4c. 
A velocity deviation signal Ve representing the difference between a value represented by the velocity instruction signal Vrv having passed through the switch 4c and a derivative value, which is obtained by a differentiating means 7 from the position signal θs that is detected by the position detecting means 6 and represents the position of a motor 13, is inputted to a velocity control means 8.
A velocity control means 8 has a velocity proportional control means 9 and a velocity integral control means 10. When a velocity deviation signal Ve is inputted to the velocity control means 8, the velocity deviation signal Ve is transmitted to both the velocity proportional control means 9 and the velocity integral control means 10, which respectively calculate electric current instruction values. Then, the velocity control means 8 outputs a current instruction value Ir, which is obtained by adding up the calculated electric current instruction values, to a current limiting means 11. The current limiting means 11 limits the current instruction value Ir to a maximum current value that can be outputted by a current control means 12. When a current is limited by this current limiting means 11, the current limiting means 11 instructs the velocity integral control means 10 to stop integration. The velocity integral control means 10 is configured to stop integration to thereby suppress, when electric-current limitation is canceled, occurrence of an overshoot with respect to the velocity instruction value due to unnecessary integration of the velocity deviation signal Ve generated during the electric current is limited. Thus, the current control means 12 controls electric current of the motor 13 according to the current limit value Ir1 outputted from the current limiting means 11.
Further, FIG. 15 illustrates a technique (PCT WO03/085816A1) invented to solve the problem of the control apparatus shown in FIG. 14. In a control apparatus shown in FIG. 15, a switching means 4 of an instruction generating means 1 selects one of a position control operation and a velocity control operation according to an operation mode without performing an operation of switching between the position control loop and the velocity control loop as shown in FIG. 14. A velocity instruction signal Vrv generated by a velocity instruction means 2 is converted by an integrating means 14 into a position instruction signal θr corresponding to the velocity instruction signal Vrv. Further, a model position generating means 15 calculates an ideal position of the motor 13 from an equivalent position control system model, which includes a characteristic of an object to be controlled, according to the position instruction signal θr. When the current limiting means 11 limits the electric current to a maximum current, a position correction means 19 instructs correction of a position instruction in the motor control apparatus and operates according to the deviation between the position of the motor 13, which is calculated and outputted from the model position generating means 15, and that of the motor 13, which is actually measured by a position detecting means 6.
In the conventional motor control apparatus shown in FIG. 14, when the velocity control operation is requested, the position loop is separated therefrom, so that the motor is controlled by the velocity loop. In cases where the orientation is performed to position when the spindle is stopped, where synchronous tapping is performed, where an operation of the spindle is performed in synchronization with another spindle, and where cutting is performed under position control, the position loop is connected thereto thereby to perform a position control operation of the motor. This motor control apparatus performs the switching every operation mode. Thus, it is necessary for smoothly switching between the velocity loop and the position loop to once reduce the velocity of the motor to a certain velocity. First, the switch 4b shown in FIG. 14 is connected. An operation of the motor is continued at a constant velocity until a velocity instruction operation signal Vr outputted by the position control means 5 is matched with a velocity instruction signal Vrv outputted from the velocity instruction means 2 in the instruction generating means 1. When a match therebetween occurs, it is necessary to connect the switch 4c. Thus, a switching operation requires time. Switching timing is complicated. Further, at the orientation, the velocity of the motor is once reduced to a certain velocity. Thereafter, a position instruction designating positions from a position-within-one-revolution of the motor at that time to a stopping position in the instruction generating means 1 is generated. The current of the motor is reduced by the current control means 11 with a damping time constant with which the current does not reach the current limit value. Thus, the positioning is performed. Therefore, at the orientation, time required to reduce the velocity is long, as compared with a deceleration time needed when an ordinary velocity control operation is performed.
Further, on the condition that the velocity loop control mode may be unused, and that only the position loop control mode may be used in all operations, it is necessary to use the apparatus by reducing an acceleration or deceleration gradient within a range, in which torque is unsaturated, so as not to increase the position deviation due to the torque saturation caused by the current limitation, as not to cause an overshoot with respect to a target velocity, and as not to delay a deceleration start with respect to a deceleration instruction. Consequently, this conventional motor control apparatus has a problem in that an acceleration or deceleration time is long.
Further, the control apparatus (PCT WO03/085816A1) shown in a block diagram of FIG. 15 has been invented to solve the problem of the conventional motor control apparatus. When the current limiting means 11 limits the current of the motor to the maximum current due to saturation of a motor output voltage and to shortage of torque corresponding to an instructed acceleration at acceleration or deceleration of the motor, the position correction means 19 instructs correction of the position instruction in the motor control apparatus and operates according to the deviation between the position of the motor 13, which is calculated and outputted by the model position generating means 15, and that of the motor 13, which is actually measured by the position detecting means 6. Thus, current limitation is canceled. In response to a subsequent position instruction, the position of the motor is corrected to a desired position when conditions for satisfactorily following the subsequent position instruction are met.
Practically, a position correction amount control means 19a in the position correction means 19 puts a switch 19b into a connected state according to a current limiting instruction I1 transmitted from the current limiting means 11. Thus, a signal representing a virtual position deviation θd between the position of the motor 13, which is calculated by the model position generating means 15, and that of the motor 13, which is actually measured by the position detecting means 6, passes through the switch 19b by way of a differentiating means 17 and is outputted through as an integrating means 20 as representing a correction position deviation amount θcd. Thus, in a case where the position instruction means 3 is selected by a switch 4d, correction is performed by substantially subtracting the virtual position deviation θcd from the position instruction signal θr. Consequently, the conventional motor control apparatus has advantages in that a follow delay from the position instruction signal θr in the instruction generating means 1 is apparently eliminated, and that occurrence of an overshoot is suppressed when the current limitation is canceled.
FIG. 16 includes charts illustrating changes in velocity, electric current, and position deviation in the motor control apparatus shown in FIG. 15. In a case where the velocity instruction means 2 is selected by the switch 4d, the velocity command operation signal Vr outputted from the position control means 5 is equivalent to the velocity instruction signal Vrv due to an excessively large value represented by the position instruction signal θr, which is obtained by being converted from the velocity instruction signal Vrv, even when the correction is conducted by subtracting the virtual position deviation θcd during current limitation is performed. Consequently, a difference from an actual velocity Vs of the motor is increased. Therefore, a large deviation is present between an electric current instruction value Ir and an electric current limitation value Ir1 before the current limitation is performed. Thus, in a case where an output torque characteristic of the motor is recovered, time taken to reduce the current instruction value Ir to the current limitation value Ir1 is long. Therefore, this conventional motor control apparatus has a problem in that velocity control and position control, which are performed since a moment in the vicinity of a time at which the current limitation is canceled, are delayed.